OpenLayers.Control.DPClick = OpenLayers.Class(OpenLayers.Control, {
	defaultHandlerOptions: {
		'single': true,
		'double': false,
		'pixelTolerance': 0,
		'stopSingle': false,
		'stopDouble': false
	},
	
	initialize: function(options) {
		this.oldppm = options.oldppm;
		options.oldppm = undefined;
		this.handlerOptions = OpenLayers.Util.extend(
			{}, this.defaultHandlerOptions
		);
		OpenLayers.Control.prototype.initialize.apply(
			this, arguments
		); 
		this.handler = new OpenLayers.Handler.Click(
			this, {
				'click': this.trigger
			}, this.handlerOptions
		);
	}, 
	
	trigger: function(e) {
		var l = this.oldppm.map.getLonLatFromViewPortPx(e.xy);
		var z = this.oldppm.map.getZoom();
		//console.log('added to '+l.lon+","+l.lat+' @ zoom: '+z+' res: '+this.oldppm.map.getResolutionForZoom(z));
		this.oldppm.addPosition(l.lon,l.lat,z);
		// closest zoom
		this.oldppm.centerMap();
	}
});